{% extends 'layout.html' %}
{% load color %}
{% load static %}
{% block content %}
    {% if search_group.get_row_list %}
        {% include 'include/search_group.html' %}
    {% endif %}

    <div style="margin-bottom: 5px" class="clearfix">
        <div class="right">
            {# 用form表单提交 #}
            <form class="form-inline" method="get">
                <div class="form-group">
                    <label for="searchBox">搜索</label>
                    <input id="searchBox" name="keyword" type="text" class="form-control"
                           placeholder="请输入关键字" value="{{ keyword }}">
                </div>
                <button type="submit" class="btn btn-default">
                    {# 放大镜图标 #}
                    <span class="glyphicon glyphicon-search"></span>
                </button>
            </form>
        </div>
    </div>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>订单号</th>
            <th>类型</th>
            <th>交易金额</th>
            <th>客户</th>
            <th>交易时间</th>
            <th>备注</th>
        </tr>
        </thead>
        <tbody>
        {% for row in pager.queryset %}
            <tr>
                <td>
                    {% if row.oid %}
                        {{ row.oid }}
                    {% else %}
                        -
                    {% endif %}
                </td>
                <td>
                    <span class="btn btn-xs btn-{{ row.charge_type|color }}">{{ row.get_charge_type_display }}</span>
                </td>
                <td>{{ row.price }}</td>
                <td>{{ row.customer.username }}</td>
                <td>{{ row.create_date|date:'Y-m-d H:i:s' }}</td>
                <td>
                    {% if row.remarks %}
                        {{ row.remarks }}
                    {% else %}
                        -
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    <ul class="pagination">
        {{ pager.html }}
    </ul>

{% endblock %}
{% block js %}
    <script>

    </script>
{% endblock %}
